library(ggplot2)
library(plotly)
#>
#> Attaching package: 'plotly'
#> The following object is masked from 'package:AnnotationDbi':
#>
#> select
#> The following object is masked from 'package:IRanges':
#>
#> slice
#> The following object is masked from 'package:S4Vectors':
#>
#> rename
#> The following object is masked from 'package:ggplot2':
#>
#> last_plot
#> The following object is masked from 'package:stats':
#>
#> filter
#> The following object is masked from 'package:graphics':
#>
#> layout
data(iris)
g <- ggplot(iris, aes(Sepal.Length, Sepal.Width, color=Species))+
geom_point()+
geom_smooth(method="lm")
ggplotly(g)
#> `geom_smooth()` using formula 'y ~ x'